﻿<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls" 
    xmlns:controlsPrimitives="clr-namespace:Microsoft.Phone.Controls.Primitives;assembly=Microsoft.Phone.Controls" 
    x:Class="PhoneInfo.ProfectSearch"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="480"
    shell:SystemTray.IsVisible="false" Style="{StaticResource TransitionPageStyle}"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" 
    xmlns:local="clr-namespace:PhoneInfo"
    xmlns:delay="clr-namespace:Delay;assembly=PhonePerformance"
    >
    <phone:PhoneApplicationPage.Resources>
        <local:FixEmptyUrl x:Key="FixUrl"/>
        <local:BoolToVis   x:Key="BoolToVis"/>
        <Style x:Key="PivotStyle1" TargetType="controls:Pivot">
            <Setter Property="Margin" Value="0"/>
            <Setter Property="Padding" Value="0"/>
            <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="ItemsPanel">
                <Setter.Value>
                    <ItemsPanelTemplate>
                        <Grid/>
                    </ItemsPanelTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="controls:Pivot">
                        <Grid HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <Grid Background="{TemplateBinding Background}" CacheMode="BitmapCache" Grid.RowSpan="3"/>
                            <controlsPrimitives:PivotHeadersControl x:Name="HeadersListElement" Grid.Row="1"/>
                            <ItemsPresenter x:Name="PivotItemPresenter" Margin="{TemplateBinding Padding}" Grid.Row="2"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </phone:PhoneApplicationPage.Resources>
    <!--LayoutRoot 是包含所有页面内容的根网格-->
    <Grid x:Name="LayoutRoot"  Background="{Binding Source={StaticResource Theme}, Path=cuTheme.TextBrush}">
        <controls:Pivot Title="pivot" Style="{StaticResource PivotStyle1}"  Margin="0,0,0,0" d:LayoutOverrides="GridBox">
            <controls:PivotItem  x:Name="Hot" Margin="12,0">
                <controls:PivotItem.Header>
                    <TextBlock Text="搜索结果"   Foreground="{Binding Source={StaticResource Theme}, Path=cuTheme.TitleBrush}"  FontSize="50" />
                </controls:PivotItem.Header>
                <ListBox ItemsSource="{Binding SearchResultItems}" Tap="ListBox_Tap" Margin="0,0,0,0">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal" Margin="10">
                                <Grid Width="90" Height="110"  Margin="5">
                                    <Image  HorizontalAlignment="Center"  VerticalAlignment="Center" 
                                            delay:LowProfileImageLoader.UriSource="{Binding Ponhe1_picurl, Converter={StaticResource FixUrl}}" 
                                            Stretch="Uniform" />
                                </Grid>
                                <StackPanel Orientation="Vertical" Width="309" Margin="10" >
                                    <StackPanel Height="40" Orientation="Horizontal">
                                        <TextBlock Text="{Binding Ponhe1_ppname}" Height="38" 
                                                   Foreground="{Binding Source={StaticResource Theme}, Path=cuTheme.SecondTextBrush}" FontSize="26"/>
                                        <TextBlock Text="{Binding Ponhe1_phonename}" Height="38" 
										           FontSize="26" Margin="10,0,0,0" 
                                                   Foreground="{Binding Source={StaticResource Theme}, Path=cuTheme.SecondTextBrush}"/>
                                    </StackPanel>
                                    <StackPanel  Orientation="Horizontal" Margin="0,20,0,0">
                                        <TextBlock Text="价格" Margin="5,0,0,0" Foreground="#FF626262"  FontSize="20"/>
                                        <TextBlock Text="{Binding Ponhe1_price}" Margin="5,0,0,0" Foreground="#FF626262"  FontSize="20"/>
                                    </StackPanel>
                                </StackPanel>
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </controls:PivotItem>
        </controls:Pivot>
    </Grid>
</phone:PhoneApplicationPage>
